//
//  UIView+WJLSetBaseView.m
//  NewMusic
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 Going. All rights reserved.
//

#import "UIView+WJLSetBaseView.h"

@implementation UIView (WJLSetBaseView)
-(CGPoint)position {
    return self.frame.origin;
}
-(void)setPosition:(CGPoint)position {
    CGRect rect = self.frame;
    rect.origin = position;
    [self setFrame:rect];
}
-(CGFloat)x {
    return self.frame.origin.x;
}
-(void)setX:(CGFloat)x {
    CGRect rect = self.frame;
    rect.origin.x = x;
    [self setFrame:rect];
}
-(CGFloat)y {
    return self.frame.origin.y;
}
-(void)setY:(CGFloat)y {
    CGRect rect = self.frame;
    rect.origin.y = y;
    [self setFrame:rect];
}
-(CGFloat)leftX {
    return self.frame.origin.x;
}
-(void)setLeftX:(CGFloat)leftX {
    CGRect rect = self.frame;
    rect.origin.x = leftX;
    self.frame = rect;
}
-(CGFloat)topY {
    return self.frame.origin.y;
}
-(void)setTopY:(CGFloat)topY {
    CGRect rect = self.frame;
    rect.origin.y = topY;
    [self setFrame:rect];
}
-(CGFloat)rightX {
    return self.frame.origin.x + self.frame.size.width;
}
-(void)setRightX:(CGFloat)rightX {
    CGRect rect = self.frame;
    rect.origin.x = rightX - self.frame.size.width;
    self.frame = rect;
}
-(CGFloat)bottomY {
    return self.frame.origin.y + self.frame.size.height;
}
-(void)setBottomY:(CGFloat)bottomY {
    CGRect rect = self.frame;
    rect.origin.y = bottomY - self.frame.size.height;
    self.frame = rect;
}
-(CGSize)size {
    return [self frame].size;
}
-(void)setSize:(CGSize)size {
    CGRect rect = self.frame;
    rect.size = size;
    [self setFrame:rect];
}
-(CGFloat)width {
    return self.frame.size.width;
}
-(void)setWidth:(CGFloat)width {
    CGRect rect = self.frame;
    rect.size.width = width;
    [self setFrame:rect];
}
-(CGFloat)height {
    return self.frame.size.height;
}
-(void)setHeight:(CGFloat)height {
    CGRect rect = self.frame;
    rect.size.height = height;
    [self setFrame:rect];
}
@end
